package com.dingwen.treasure.business.controller;

import com.dingwen.treasure.base.controller.BaseViewController;
import com.dingwen.treasure.base.pojo.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 　CorsController: Cross Origin Resource Sharing
 * 　@author dingwen
 * 　@since  2022/8/8
 */
@Api(tags = "CORS API")
@RestController
@Slf4j
@RequestMapping("cors")
public class CorsController implements BaseViewController {

    /**
     * 后端跨域解决方案1： 在允许跨域的方法或类上添加 @CrossOrigin
     *
     */
    @GetMapping
    @ApiOperation(value = "测试跨域请求", response = Result.class)
    public void test() {
        log.info("CorsController test()");
    }
}
